<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../layuimini-2/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuimini-2/css/layuimini.css" media="all">


</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <script type="text/html" id="toolbarDemo">
<!--            <div class="layui-btn-container">-->
<!--                <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 添加 </button>-->
<!--                <button class="layui-btn layui-btn-sm layui-btn-danger data-delete-btn" lay-event="deleteBatch"> 批量删除 </button>-->
<!--            </div>-->
        </script>

        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>

<!--        <script type="text/html" id="currentTableBar">-->
<!--            <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>-->
<!--            <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>-->
<!--        </script>-->

    </div>
</div>
<script src="../../../layuimini-2/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
    var $ ;
    var form;
    var table;
    var layer;
    layui.use(['form','table',"jquery"], function () {
         $ = layui.jquery;
         form = layui.form;
         table = layui.table;

        //渲染表格
        tableRender();

    });

    function tableRender(obj) {
        var data = JSON.parse(localStorage.getItem("username"));
        // $("#id1").html(data.id);
        obj.field.id=data.id
        console.log(obj.field.id)
        table.render({
            elem: '#currentTableId',
            url: '/user/userInfo.do',
            toolbar: '#toolbarDemo',
            data:obj.field,
            page: true,
            limit: 6,
            limits: [6, 12, 18, 24],
            defaultToolbar: ['filter', 'exports', 'print', {
                title: '提示',
                layEvent: 'LAYTABLE_TIPS',
                icon: 'layui-icon-tips'
            }],
            cols: [[
                {type: "checkbox", width: 50},
                {field: 'id', width: 80, title: 'ID', sort: true},
                {field: 'username', width: 100, title: '用户名'},
                {field: 'password', width: 100, title: '用户密码',templet: function (obj) {
                        return "******";
                    }},
            ]],
            skin: 'line'
        });
    }


</script>

</body>
</html>